home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 23
/
023.d81
/
up your alley
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2022-08-26
|
14KB
|
464 lines
1 iff=0thenf=1:gosub60000
5 xp=7.5 :rem * bowling joe garrett
10 rem * 2/3/86
15 rem *** main program ***
18 gosub 4500: rem * get names
20 gosub 1000: rem * initialize all
25 gosub 3000: rem * draw alley
35 for fr=1 to 10
37 : for pl=1 to np
38 : for bl=1 to 2
40 : gosub 5000: rem * get height
50 : gosub 6000: rem * roll ball
60 : gosub 10000:rem * do score
63 : if fr=10 and bl=2 and not xb(pl) then gosub 9000: rem * 10th frame?
64 poke53280,0
65 : next bl
67 : gosub 3090 : rem * reset pins
70 : next pl
80 next fr:gosub17000:rem* clear player
100 print"play again? (y/n) " : poke 198,0
105 print" "
110 get t$: ift$="" then110
120 if t$="y" then run
125 if t$<>"n" then 110
127 poke928,0:print"[147][194]ye bye bowling..."
130 load"hello connect",8:end
998 rem *** initialize everything ***
999 stop
1000 pokev+21,0:print "[147]wait...":u=rnd(-ti):eb$(1)=" ":eb$(2)=" "
1002 rem *** sprite data ***
1005 dim sc$(12,2,3) : rem * score array
1010 poke53280,0 : poke53281,12 :ap=102:poke53248+29,0
1015 forw1=1to12:forw2=1to2:forw3=1to2:sc$(w1,w2,w3)=" ":sc$(w1,w2,3)=" "
1017 nextw3:nextw2:nextw1
1020 dim pp(10) : rem * pin positions
1030 for t = 1 to 10
1040 read pp(t) : rem * read pins pos's
1050 next
1060 data 1335,1297,1377,1259,1339,1419,1221,1301,1381,1461
1070 for t1=1175 to 1181 : rem * make pins white
1080 for t2=0 to 240 step 40
1090 poke t1+t2+54272,1
1100 next t2
1110 next t1
1120 gosub 4000 : rem * score frames
1140 v=53248:poke2042,13:pokev+41,0
1370 rem *** direction data
1380 dr$(1)="[183]":dr$(2)="[197]":dr$(3)="[196]":dr$(4)="[192]":dr$(5)="[198]":dr$(6)="[210]"
1390 dr$(7)="[175]"
1990 gosub4530:return
2000 :
2998 rem *** draw alley ***
3000 print " [154] [152] "
3002 print " [154] [152] "
3005 for t=1 to 7
3010 print" [152][158][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][166][152] "
3015 next t
3020 print " [154] [152] "
3022 print " [154] [152] "
3025 print"....[157][157].[157][157].[157][157]."
3090 for t = 1 to 10
3095 : poke pp(t),81:pokepp(t)+54272,1
3100 next
3990 return
3992 pokepp(4),81:pokepp(7),81:pokepp(9),81:pokepp(10),81:bl=1:return
3996 :
3998 rem *** draw score frames ***
4000 print"[176][192][192][192][192][192][192][192][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][178][192][192][192][174]" : r=1
4010 print"[221]name [221] 1 [221] 2 [221] 3 [221] 4 [221] 5 [221]"
4020 print"[171][192][192][192][192][192][192][192][192][192][192][219][192][178][192][219][192][178][192][219][192][178][192][219][192][178][192][219][192][178][192][179]"
4030 print"[221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221] [221]"
4040 print"[221] [171][192][177][192][219][192][177][192][219][192][177][192][219][192][177][192][219][192][177][192][179]"
4050 print"[221] [221] [221] [221] [221] [221] [221]"
4060 rem print"[171][192][192][192][192][192][192][192][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][219][192][192][192][179]"
4070 if r=1 then r=2 : goto 4020
4075 print"[221] [221] [221] [221] [221] [221] [221]"
4080 print"[145][173][192][192][192][192][192][192][192][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][177][192][192][192][189]"
4090 pokev+21,0:return
4480 rem *** get names
4490 :
4500 if peek(850)<>7 or peek(851)<>255 then load"ball",8,1
4502 pokev+21,0:input"[147]1 or 2 players";np:if np<1 or np>2 then 4500
4503 input"[147]what is your name player 1";nm$(1)
4504 if np=1 then 4510
4505 input"[147]what is your name player 2";nm$(2)
4510 nm$(1)=left$(nm$(1),9)
4512 nm$(2)=left$(nm$(2),9)
4515 return
4525 rem *** print players names
4530 print"" nm$(1)
4532 print"" nm$(2)
4535 print" "
4550 return
4980 rem *** input where to throw ball
4990 :
5000 pokev+21,0:gosub5200:dn$="[157] [153]":tc=3 :ht=1 :dn=4 : sp=23:sr=0
5005 :p0=0:p1=0:p2=0:p3=0:p4=0:p5=0:p6=0:p7=0:p8=0:p9=0:fs=0:gosub 17000
5010 printdn$;:fort=1 to dn:print"";:next t: print dr$(tc);
5020 get t$:if t$="" then 5020
5030 if t$=chr$(13) then sp=sp+dn/2-1:goto 5300
5040 if t$="" then sp=sp+1:tc=tc+1
5045 if t$="s" then fs=-1:sp=20:goto5300
5050 if t$="[145]" then sp=sp-1:tc=tc-1
5060 if sp<0 then sp=0: dn=1:tc=1:goto5010
5070 if sp=49 then sp=48:dn=7:tc=7:goto5010
5080 if tc=8 then tc=1
5090 if tc=0 then tc=7
5100 dn=int(sp/7)+1: goto 5010
5200 print"align the green mark using cursor keys "
5210 print"press return when satisfied with mark":return
5300 print"[158]use space bar to curve ball during roll"
5310 print" "
5320 print" [157] [157] [157] [157] [157] [157] [157] "
5330 return
5980 rem *** roll ball ***
5990 :
6000 pokev+4,0:pokev+16,0:y=sp+75:pokev+5,y:pokev+21,4
6002 gosub19500:rem *** ball roll sound
6005 forp=1to10:p(p)=32:nextp
6010 fort=1 to 255 step 3:pokev+4,t:pokev+5,y:y=y+rnd(1)*.5-.25
6030 gett$:ift$=" "then y=y-rnd(1)
6040 nextt:sl=0:if y>96andy<103 then sl=-1
6042 gosub6500: rem *** proc pin 1
6100 pokev+16,4:fort=1 to 11:pokev+4,t:pokev+5,y:nextt
6110 gosub 6700:rem *** proc row 2
6120 pokev+16,4:fort=12 to 27:pokev+4,t:pokev+5,y:nextt
6130 gosub 6900:rem *** proc row 3
6140 pokev+16,4:fort=28to43 :pokev+4,t:pokev+5,y:nextt
6150 gosub 7100:rem *** proc row 4
6154 fort8=7to10:w=pp(t8):ifpeek(w)=apthenpokew+54272,7
6155 if peek(pp(10))<>ap then pokepp(10)+54272,1
6156 next
6160 fort=44to86 :pokev+4,t:pokev+5,y:nextt
6170 gosub8050:gosub 8000: if ps=0 and fr<10 then bl=2
6180 pokes+4,0:pokes+11,0:return
6498 rem *** hit pin 1? ***
6500 if y>90 and y<109 then gosub20000:pokepp(1),ap:pokepp(1)+54272,7
6510 p1=-1:return
6698 rem *** knock down row 2 ***
6699 :
6700 j2=0:j3=0: ify>=117 or y<=81 then return
6705 ify>91 and y<107 then j2=-1:j3=-1: goto6720
6710 if(y>81 and y<92) then j2=-1 :goto6720
6715 if(y>106 and y<117) then pokepp(3),ap:pokepp(3)+54272,7:return
6720 if j2 then pokepp(2),ap:pokepp(2)+54272,7
6725 if j3 then pokepp(3),ap:pokepp(3)+54272,7
6730 if y<98 andp1 then p6=-1:return
6735 ify>100 andp1 then p4=-1:return
6898 rem *** knock down row 3 ***
6899 :
6900 if (y<=73 or y >=125) then return
6902 gosub18000: gosub19000
6905 if y<=89 then pokepp(4),ap:goto6950
6910 if y<=92 then pokepp(4),ap:pokepp(5),ap:goto6940
6915 if y<=105 then pokepp(5),ap:goto6940
6925 if y<109 then pokepp(5),ap:pokepp(6),ap:goto6940
6930 if y<=124 then pokepp(6),ap
6940 ifp4 then pokepp(4),ap
6945 ifp6 then pokepp(6),ap
6947 rem ifbl=2 then y=75
6950 :
6960 fort8=4to6:w=pp(t8):ifpeek(w)=apthen pokew+54272,7
6970 next:return
7098 rem *** knock down row 4 ***
7099 :
7100 pr=5:if (y<=66 or y >=132) then return
7105 if y<82 then pokepp(7),ap:pokepp(7)+54272,7:return
7110 if y<85 then pokepp(7),ap:pokepp(8),ap:pr=3:return
7115 if y<98 then pokepp(8),ap:pr=7:goto7150
7120 if y<101 then pokepp(8),ap:pr=2:pokepp(9),ap:goto7150
7125 if y<114 then pokepp(9),ap:pr=7:goto7150
7130 if y<117 then pokepp(9),ap:pr=3:pokepp(10),ap:goto7150
7135 pokepp(10),ap
7150 if bl=2 then pr=1
7153 gosub23000:if rd then p7=-1
7155 gosub23000:if rd then p8=-1
7160 gosub23000:if rd then p9=-1
7165 gosub23000:if rd then p0=-1
7170 if p7 thenpokepp(7),ap
7175 if p8 thenpokepp(8),ap
7180 if p9 thenpokepp(9),ap
7185 if p0 thenpokepp(10),ap
7190 if p1 and not sl then if int(rnd(1)*10)+1=5 then fs=-1
7200 if bl=1 then return
7210 if int(rnd(1)*500)<>428then return
7220 fs=-1:print"!!! i can't believe it !!! "
7230 print" "
7240 return
7251 if not sl then return
7999 rem *** count standing pins ***
8000 ps=0 :forf=1to10:if peek(pp(f))=81then